package com.wao.menu.repository;

import com.wao.menu.domain.Item;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * Spring Data JPA repository for the Item entity.
 */
@SuppressWarnings("unused")
@Repository
public interface ItemRepository extends JpaRepository<Item, Long> {

    List<Item> findByMenuIdAndLevelOrderByDisplayOrder(Long menuId, Integer level);

    Page<Item> findByMenuId(Long menuId, Pageable pageable);

    Page<Item> findByParentId(Long parentId, Pageable pageable);
}
